package com.example.common.response;

/**
 * @Author: ChenZhiXiang
 * @Date: 2019/6/18 21:59
 * @Description:
 */
public enum ComResponseEnum implements IResponseEnum {

    FAILURE(-1, "系统错误"),
    SUCCESS(200, "操作成功"),
    OPERATION(0,"操作失败"),

    USER1(1001,"验证码错误"),
    USER2(1002,"用户不存在"),
    USER3(1003,"密码错误"),
    USER4(1004,"登录出现了不可预知的错误"),
    USER5(1005,"添加用户失败"),
    USER6(1006,"已存在"),

    AUTH1(3001,"权限同步失败"),
    SENSITIVE(2001,"含有敏感字符");

    Integer code;

    String msg;

    @Override
    public Integer code() {
        return this.getCode();
    }

    @Override
    public String msg() {
        return this.getMsg();
    }

    ComResponseEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
